Kernel.module.define('internet', {
	
	title: 'internet',
	file: 'internet.php',
	
	init: function() {
		var module = this;

		$('#internet_go').on('click', function() {
			jsKeyboard.hide();
			var uri = $('#browseruri').val();
			//var iframe = document.getElementById('internetContent');
			$("#internetContent").html("<object data='http://"+uri+"'/ width='100%' height='100%'>");
		});
		
		$('#internet_go').button();

		$(':input').not('[type="reset"]').not('[type="submit"]').on('focus, click', function (e) {
			jsKeyboard.show();
			jsKeyboard.currentElement = $(this);
			jsKeyboard.currentElementCursorPosition = $(this).getCursorPosition();
			console.log('keyboard is now focused on ' + jsKeyboard.currentElement.attr('name') + ' at pos(' + jsKeyboard.currentElementCursorPosition + ')');
		});

		$(':input').on('focusout', function (e) {
			jsKeyboard.hide();
		});
		
		$("#internetContent").on('click', function() {
			$(':input').blur();
		});
	}
	
});
